% *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 
%	Copyright (C) 1991 - 1993 Y&Y, Inc. 
% Copyright 2007 TeX Users Group.
% You may freely use, modify and/or distribute this file.
% *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 

% ============================================================================
% Accented and composite characters in fonts that do not use TeX text encoding
%	PC version (for `TEXANNEW' encoding vector)  VERSION 1.5 (1993 April 1)
% ============================================================================

% Plain TeX - and hence lplain TeX - have accents hard-wired to certain codes.

% A non-CM font can be reencoded to TeX text encoding ---
% in this case accents and composite character will be where TeX expects them.
% But, quite often it is advantageous to encode a font another way.
% This can provide access to many characters not found in TeX text encoding.

% When a font is reencoded, compound characters and accents may be moved.
% This will prevent TeX's normal handling of compound characters and accents.
% This file indicates how to deal with this ---
%    --- and concludes with sample code specific for `Windows ANSI' encoding.

% Changes required for math constructions that use roman font are at the end

% You may wish to just \input this file in your TeX source.

% This defines ` to be active, since `quoteleft' is remapped from 96 to 145
% If you don't want this, then do \catcode96=12 after \input accents.tex

% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 

% Protect against style files that make quotedbl `active'

\chardef\dblcode=\catcode`\"	% save catcode of quotedbl
\catcode`\"=12			% make quotedbl what it should be

% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 

% NOTE: plain TeX (and LaTeX) has the accent character positions hardwired to:

% 16 for `dotlessi', 17 for `dotlessj', 
% 18 for `grave', 19 for `acute', 20 for `caron', 
% 21 for `breve', 22 for `macron', 
% 23 for `ring', 24 for `cedilla',
% 25 for `germandbls', 26 for `ae', 27 for `oe', 
% 28 for `oslash', 29 for `AE', 30 for 'OE', 31 for `Oslash',
% 94 for `circumflex', 95 for `dotaccent', 125 for `hungarumlaut',
% 126 for `tilde', 127 for `dieresis',
% (see page 356 of the TeX book for additional information)

% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 

% The following sample redefinitions are for `Windows ANSI' encoding:

% Tell TeX where various special characters are:

\chardef\ae=240	% "F0	ae
\chardef\oe=156 % "9C	oe
\chardef\o=248  % "F8	oslash
\chardef\AE=208	% "D0	AE
\chardef\OE=140 % "8C	OE
\chardef\O=216  % "D8	Oslash
\chardef\i=157  % "9D	dotlessi 
\chardef\ss=222	% "DE	germandbls

% The following are constructed from pieces in CM, but exist in most T1 fonts

\chardef\aa=229 \chardef\AA=197 % aring, Aring
\chardef\cc=231 \chardef\CC=215 % ccedilla, Ccedilla

\chardef\l=189 \chardef\L=190	% lslash, Lslash

\chardef\pounds=163 \chardef\copyright=169

% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 

% For backward compatability, provide for use of font with TeX's \accent:
% (Although it is better to use actual accented characters, since \accent
% creates explicit kerning which breaks the hyphenation machinery)

\def\`#1{{\accent96 #1}}	% grave
\def\'#1{{\accent180 #1}}	% acute
\def\v#1{{\accent141 #1}}	% caron
\def\u#1{{\accent198 #1}}	% breve
\def\=#1{{\accent175 #1}}	% macron
\def\^#1{{\accent136 #1}}	% circumflex
\def\.#1{{\accent199 #1}}	% dotaccent
\def\H#1{{\accent205 #1}}	% hungarumlaut
\def\~#1{{\accent152 #1}}	% tilde
\def\"#1{{\accent168 #1}}	% dieresis

% Or, we can use the 58 pre-built accented character pseudo ligatures
% --- but only if the TFM files for the text fonts have them.
% This prevents the introduction of explicit kerning by \accent
% --- but is limited to the `standard' 58 built-in accented characters,

% \def\`{\char96 }	% grave
% \def\'{\char180 }	% acute
% \def\v{\char141 }	% caron
% \def\^{\char136 }	% circumflex
% \def\~{\char152 }	% tilde
% \def\"{\char168 }	% dieresis
% \def\c{\char184 }	% cedilla
% \def\={\char175 }	% macron % no macron accented chars in standard fonts
% \def\aa{\char176 a} \def\AA{\char176 A}	% aring and Aring

% underline and cedilla accents (macron at 175, cedilla at 184)

\def\b#1{\oalign{#1\crcr\hidewidth
    \vbox to.2ex{\hbox{\char175}\vss}\hidewidth}}
\def\c#1{\setbox0\hbox{#1}\ifdim\ht0=1ex\accent184 #1%
  \else{\ooalign{\hidewidth\char184\hidewidth\crcr\unhbox0}}\fi}

% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 

% Changes required in math maros when roman font is reencoded to `ansinew'.
% (An alternative is to draw the accents from the math fonts)

% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 

% Make the adjustments needed when roman font is reencoded to `Windows ANSI':

\def\acute{\mathaccent"70B4 }	% acute
\def\grave{\mathaccent"7060 }	% grave
\def\ddot{\mathaccent"70A8 }	% dieresis
\def\tilde{\mathaccent"7098 }	% tilde
\def\bar{\mathaccent"70AF }	% macron
\def\breve{\mathaccent"70C6 }	% breve
\def\check{\mathaccent"708D }	% caron
\def\hat{\mathaccent"7088 }	% circumflex
\def\dot{\mathaccent"70C7 }	% dotaccent

% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 

% The following provides access to the 58 accented/ composite characters.
% Some convenient abbreviations conflict with macros in plain or lplain
% (for example, \aa, \Aa, \ae, \Ae, \oe, \Oe, \sc, \Sc in plain TeX)
% So these have had to be be named something slightly less menmonic.

% 58 `standard' accented chars exist in many fonts - including BSR CM from Y&Y
% One can define control sequences to access these directly as follows.

% \chardef\ay=228 \chardef\ee=235 \chardef\ie=239 \chardef\oy=246
% \chardef\ue=252 \chardef\ye=254 % a, e, i, o, u, y - dieresis

% \chardef\Ay=196 \chardef\Ee=203 \chardef\Ie=207 \chardef\Oy=214
% \chardef\Ue=220 \chardef\Ye=159 % A, E, I, O, U, Y - dieresis

% \chardef\ax=225 \chardef\ea=233 \chardef\ia=237 \chardef\oa=243
% \chardef\ua=250 \chardef\ya=253 % a, e, i, o, u, y - acute

% \chardef\Ax=193 \chardef\Ea=201 \chardef\Ia=247 \chardef\Oa=211
% \chardef\Ua=218 \chardef\Ya=221 % A, E, I, O, U, Y - acute

% \chardef\ag=224 \chardef\eg=232 \chardef\ig=236 \chardef\og=242
% \chardef\ug=249 % a, e, i, o, u - grave

% \chardef\Ag=192 \chardef\Eg=200 \chardef\Ig=204 \chardef\Og=210
% \chardef\Ug=217 % A, E, I, O, U - grave

% \chardef\ac=226 \chardef\ec=234 \chardef\ic=238 \chardef\oc=244
% \chardef\uc=251 % a, e, i, o, u - circumflex

% \chardef\Ac=194 \chardef\Ec=202 \chardef\Ic=230 \chardef\Oc=212
% \chardef\Uc=219 % A, E, I, O, U - circumflex

% \chardef\At=195 \chardef\Nt=209 \chardef\Ot=213 % A, N, O - tilde

% \chardef\at=227 \chardef\nt=241 \chardef\ot=245 % a, n, o - tilde

% \chardef\sr=154 \chardef\zr=255 % scaron, zcaron

% \chardef\Sr=138 \chardef\Zr=223 % Scaron, Zcaron

% Remaining four `composites': aring, Aring, ccedilla, Ccedilla defined above.

% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 

% To deal with \@parboxrestore kludge in LaTeX (restores grave, acute, macron)

\chardef\atcode=\catcode`\@	% save catcode of at sign
\catcode`\@=11			% make at a letter

\let\@acci=\'
\let\@accii=\`
\let\@acciii=\=

\catcode`\@=\atcode		% restore original catcode of at sign

% NOTE: if grave, acute, and macron accents are lost after certain LaTeX
% enviroments are used (such as the tabbing environment), then it is because
% a LaTeX macro/style file is read in after this that redefines the above.

% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 

% If you want to use < for `guillesinglleft' and > for `guillesingright'
% then uncomment the following lines:

% \catcode`\<=\active \chardef<=172
% \catcode`\>=\active \chardef>=173

% If you use < for `exclamdown', > for `questiondown', and | for `emdash'
% then uncomment the following lines:

% \catcode`\<=\active \chardef<=161
% \catcode`\>=\active \chardef>=191
% \catcode`\|=\active \chardef|=151

\def\lq{\char145 } \def\rq{\char39 }

% Note that \lq and \rq also provide access to ` and '

\catcode`\"=\dblcode	% restore original catcode of quotedbl

% `quoteleft' has moved from 96 to 145 to make space for `grave' in ANSI:

\catcode`\`=\active \chardef`=145

% NOTE: making ` active, as above, may prevent some other TeX macro packages
% from working, so it is best to make this change only _after_ those are read
% --- or, use \catcode96=12 before reading the macro package and use
% \catcode96=13 after it (so that `quotedblleft' ligature works correctly).

%  \catcode96=12 % uncomment this line to avoid problems with `

\endinput

% **************************************************************************

% NOTE: definitions have embedded numbers that depend on the chosen encoding
% These will need to be changed if you use an encoding other than `TEXANNEW'

% **************************************************************************
